﻿namespace System.Data.Entity
{
    public class GuidDbContext : DbContext<Guid>
    {
        public override Guid Insert<TEntity>(TEntity entity)
        {
            if (entity.Id == default(Guid))
                entity.Id = Guid.NewGuid();
            return base.Insert(entity);
        }
    }
}
